Skip to content

Adding OBO event to init OBO apis#3724

Merged
trwalke merged 4 commits intomasterfrom
trwalke/AddNewOboEvent
Feb 17, 2026
Merged

Adding OBO event to init OBO apis#3724
trwalke merged 4 commits intomasterfrom
trwalke/AddNewOboEvent

Conversation

@trwalke
Copy link
Member

@trwalke trwalke commented Feb 13, 2026

Adding OBO event to init OBO apis
This pull request introduces new extensibility points to the On-Behalf-Of (OBO) authentication flow in Microsoft.Identity.Web, allowing developers to hook into the initialization phase of the OBO process. The changes are applied consistently across all supported target frameworks and involve both new delegate types and methods for synchronous and asynchronous event handling.

The most important changes are:

New OBO Initialization Extension Points:

  • Added new delegates BeforeOnBehalfOfInitialized and BeforeOnBehalfOfInitializedAsync, along with corresponding properties on TokenAcquisitionExtensionOptions (OnBeforeOnBehalfOfInitialized, OnBeforeOnBehalfOfInitializedAsync). These allow custom logic to be executed before the OBO flow is fully initialized.
  • Introduced new virtual Invoke methods for both delegates, supporting both synchronous and asynchronous event handling during OBO initialization.
  • Added new method InvokeOnBeforeOnBehalfOfInitializedAsync to TokenAcquisitionExtensionOptions, enabling asynchronous invocation of the new initialization event.

Integration with OBO Flow:

  • Updated TokenAcquisition.cs to invoke the new OBO initialization event (InvokeOnBeforeOnBehalfOfInitializedAsync) before proceeding with the rest of the OBO authentication process, allowing the token or user information to be modified at this early stage.

Cross-Framework Consistency:

  • All of the above changes are reflected in the public API files for .NET Standard 2.0, .NET 4.6.2, .NET 4.7.2, .NET 8.0, .NET 9.0, and .NET 10.0, ensuring the extensibility points are available across all supported target frameworks. [1] [2]

Minor Codebase Maintenance:

  • Added a missing using System; statement in TokenAcquisitionExtensionOptions.cs to support the new delegate types.

@trwalke trwalke requested a review from a team as a code owner February 13, 2026 07:04
@trwalke trwalke merged commit dca1fc0 into master Feb 17, 2026
4 checks passed
@trwalke trwalke deleted the trwalke/AddNewOboEvent branch February 17, 2026 19:24
This was referenced Mar 1, 2026
This was referenced Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants